/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Thai Dac Vinh
 */
@Embeddable
public class MoneytransferlogPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "TRANSFERDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date transferdate;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 5)
    @Column(name = "SENDERACCOUNT")
    private String senderaccount;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 5)
    @Column(name = "RECEIVERACCOUNT")
    private String receiveraccount;

    public MoneytransferlogPK() {
    }

    public MoneytransferlogPK(Date transferdate, String senderaccount, String receiveraccount) {
        this.transferdate = transferdate;
        this.senderaccount = senderaccount;
        this.receiveraccount = receiveraccount;
    }

    public Date getTransferdate() {
        return transferdate;
    }

    public void setTransferdate(Date transferdate) {
        this.transferdate = transferdate;
    }

    public String getSenderaccount() {
        return senderaccount;
    }

    public void setSenderaccount(String senderaccount) {
        this.senderaccount = senderaccount;
    }

    public String getReceiveraccount() {
        return receiveraccount;
    }

    public void setReceiveraccount(String receiveraccount) {
        this.receiveraccount = receiveraccount;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (transferdate != null ? transferdate.hashCode() : 0);
        hash += (senderaccount != null ? senderaccount.hashCode() : 0);
        hash += (receiveraccount != null ? receiveraccount.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MoneytransferlogPK)) {
            return false;
        }
        MoneytransferlogPK other = (MoneytransferlogPK) object;
        if ((this.transferdate == null && other.transferdate != null) || (this.transferdate != null && !this.transferdate.equals(other.transferdate))) {
            return false;
        }
        if ((this.senderaccount == null && other.senderaccount != null) || (this.senderaccount != null && !this.senderaccount.equals(other.senderaccount))) {
            return false;
        }
        if ((this.receiveraccount == null && other.receiveraccount != null) || (this.receiveraccount != null && !this.receiveraccount.equals(other.receiveraccount))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MoneytransferlogPK[ transferdate=" + transferdate + ", senderaccount=" + senderaccount + ", receiveraccount=" + receiveraccount + " ]";
    }
    
}
